home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Library / +ORC / Orc pac 2 / FILEZ.ZIP / DMPEXE12.ZIP / DUMPEXE.DOC next >
Encoding:
Text File  |  1995-05-22  |  25.1 KB  |  513 lines

  1.  ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  2.  █                                                                            █
  3.  █                     <*>   EXEdumper version 1.2   <*>                      █
  4.  █                                                                            █
  5.  █                  by ▄─▄ ▄   ▄─▄ ▄─▄ ▄─▄ ▄─▄ ▄ ▄─▄ ▄─▄                      █
  6.  █                     █ █ █─▄ ▀─▄ █─  ▀─▄ ▀─▄ ▄ █ █ █ █                      █
  7.  █                     █ █ █ █ ▄ █ █   ▄ █ ▄ █ █ █ █ █ █                      █
  8.  █                     ▀▀▀ ▀▀▀ ▀▀▀ ▀▀▀ ▀▀▀ ▀▀▀ ▀ ▀▀▀ ▀ ▀ 1995                 █
  9.  █                                                                            █
  10.  █────────────────────────────────────────────────────────────────────────────█
  11.  █ Handle          Real name           Age   Profession   Group activity      █
  12.  █────────────────────────────────────────────────────────────────────────────█
  13.  █ Bugsy           Benjamin Petersen    22   Programmer   Coder, organizer    █
  14.  █ Spawn           Michael Skovslund    21   Programmer   Coder, gfx          █
  15.  █ UniSon          Henrik Eiriksson     22   Study IFA    Music, art          █
  16.  █ Fading Nimbus   Emil Hansen          20   Study HTX    Music               █
  17.  █────────────────────────────────────────────────────────────────────────────█
  18.  █                                                                            █
  19.  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  20.  
  21. INDEX 
  22.  
  23.   History
  24.   Introduction
  25.   Disclaimer
  26.   Keyboard layout
  27.   Program dokumentation
  28.   Soft-Ice user notice
  29.   How to unpack a exefile
  30.   Greetings
  31.  
  32.  
  33. ■ History
  34.  
  35.   Version   Notice
  36.  
  37.       1.0   Never released to public, only for our beta-testers
  38.       1.1   First public release
  39.       1.2   Now with Soft-Ice debugger support. Activate with INT FCh
  40.  
  41. ■ Introduction
  42.  
  43.   This program is able to unpack ANY exe-file, however this can only be done
  44.   if it's packed with a exe-packer. Of course it can't be done by inserting
  45.   a coin into the cryptomate. You have to do something for it. This is where 
  46.   you and your debugger comes in.
  47.  
  48.   All you have to do is this :
  49.     Load the program into your favourite debugger, debug the program until 
  50.     first original instruction, dump the code/data, terminate the program, 
  51.     allocate 4 Kb, reload the program, debug until first original instruc-
  52.     tion, dump the code/data, terminate the program, deallocate 4 Kb and
  53.     read MakeExe.Doc
  54.   
  55.   If this sounds easy, exit your doc reader, if not, keep on reading. 8+)
  56.                                                                         
  57. ■ Disclaimer
  58.  
  59.   This software has been tested and found to work properly. OBSESSiON have no 
  60.   responsability whatsoever for any damages caused by use, or misuse, of this 
  61.   software.
  62.  
  63.   If you, after a 24 hour test period, wish to continue using this program,
  64.   you NEED to send me a postcard with your name and address. This is the
  65.   only way I can see that someone is really using this software. If I don't
  66.   receive any postcard, I won't update the program. This means :
  67.   NO MORE UPDATE OR BUG FIXES, IF NO POSTCARD IS SEND TO ME!
  68.  
  69.  
  70. ■ Keyboard layout
  71.  
  72.   Left shift + right shift : Activate the resident part of DumpExe
  73.   TAB                      : Jump to next menu block
  74.   Shift TAB                : Jump to previous menu block
  75.   Arrow up/down            : Next/previous menu selection
  76.   Arrow left/right         : Next/previous number in input field
  77.   ESC                      : Terminate DumpExe or return to previous state
  78.   Enter                    : Confirm selection/input
  79.  
  80. ■ Program documentation 
  81.  
  82.   Install DumpExe into memory, by starting the file DUMPEXE.EXE. The program 
  83.   will now be resident (TSR) in memory. To activate, press LEFT SHIFT and 
  84.   RIGHT SHIFT at the same time. A menu, the one shown here below, will appear.
  85.   To return to what you were doing, press ESC. 
  86.  
  87.   Notice : You cannot start DumpExe by pressing the hotkey while you are at
  88.   the dos command line. This is because dos says it's busy, or not safe to 
  89.   interrupt, at the present time. If you try to start it anyhow, two beep can
  90.   be heard from the PC-speaker. This beep sequence can also appear while an 
  91.   attempt have been made inside a debugger, ignore this and try again.
  92.  
  93.          ╔═══ Exe-dumper v1.2 CARDWARE 1995 by BUGSY of OBSESSiON [1]╗
  94.          ║───────── First file ────────┬───────── Second file ───────║
  95.          ║ CS   : 0000             [2] │ CS   : 0000             [3] ║
  96.          ║ IP   : 0000                 │ IP   : 0000                 ║
  97.          ║ SS   : 0000                 │ SS   : 0000                 ║
  98.          ║ SP   : 0000                 │ SP   : 0000                 ║
  99.          ║ PSP  : 0000                 │ PSP  : 0000                 ║
  100.          ║ Size : 00000 (0)            │ Size : 00000 (0)            ║
  101.          ║ Name : #NoName#.1           │ Name : #NoName#.2           ║
  102.          ║─────────────────────────────┼─────────────────────────────║
  103.          ║      Dump exe-code      [4] │     Dump exe-code       [5] ║
  104.          ║      Autodetect name        │     Autodetect name         ║
  105.          ║      Autodetect size        │     Autodetect size         ║
  106.          ║─────────────────────────────┴─────────────────────────────║
  107.          ║                       Allocate 4Kb                    [6] ║
  108.          ║                       Auto-Config                         ║
  109.          ║                       Reset menu                          ║
  110.          ║                       Uninstall                           ║
  111.          ║───────────────────────────── Free 167 kb. Slack 0 kb ─[7]─║
  112.          ║                                                       [8] ║
  113.          ╚═══════════════════════════════════════════════════════════╝
  114.  
  115.   Overview
  116.     [1] Copyright text. 
  117.     [2] Data for first filedump, set by the user.
  118.     [3] -do- for second file.
  119.     [4] Menu concerning first filedump.
  120.     [5] -do- for second file.
  121.     [6] General purpose menu, concerning global use of DumpExe.
  122.     [7] Information about current memory status.
  123.     [8] Status message from DumpExe and input prompt from user.
  124.  
  125.   Explenation
  126.     [1] Copyright text. 
  127.           Tells who made this brilliant program.
  128.  
  129.     [2] This sub window are used to enter information about the program you
  130.         want to unpack. You have to fill out ALL fields, for a working copy
  131.         of the unpacked file.
  132.  
  133.           CS   : Current code segment
  134.           IP   : Current instruction pointer
  135.           SS   : Current stack segment
  136.           SP   : Current stack pointer
  137.           PSP  : Current program prefix segment
  138.           Size : Size of program in bytes
  139.           Name : Name of dump file
  140.  
  141.         To change a value, move selector to decided item and press enter.
  142.         Enter the new value and press enter again.
  143.         REMARK : All numbers are shown and entered in heximal values.
  144.  
  145.     [3] -do- for [2]
  146.  
  147.     [4] Menu for processing first unpacked data block. It is use for dumping
  148.         the code/data block entered in [2] or [3].
  149.  
  150.         Menuitems available are :
  151.  
  152.           Dump exe-code    : Press this one to dump selected data block.
  153.  
  154.           Autodetect name  : Make DumpExe autodetect the name of the program
  155.                              it are processing and use it for the dump name.
  156.  
  157.           Autodetect size  : Used to make the program autodetect the size of 
  158.                              the data block. There are too ways to autodetect 
  159.                              the size of a program. It can be done by Stack 
  160.                              or PSP. The most common way is 'By Stack', 
  161.                              because this will give a smaller exefile.
  162.  
  163.     [5] -do- for [4]
  164.  
  165.     [6] This is a misc. menu, containing rutines for the global use of the
  166.         exe-dumper.
  167.  
  168.         Menuitems available are :
  169.  
  170.           Allocate 4Kb : Used to allocate/deallocate a block of 0100h
  171.                          paragraphs or 4 kb. This should be done after 
  172.                          first dump and termination, and before reload
  173.                          of the program. Please take a look at the tutorial
  174.                          at the bottom of this document.
  175.  
  176.  
  177.           Auto-Config  : Add 0101h to all segment registers in [2] and 
  178.                          store them in [3]. It is usefull after preparing 
  179.                          for second dump. This only works 9 out 10 packed
  180.                          files. Please notice that CS in [3] matches the one
  181.                          shown by the debugger. If not, you have to enter all
  182.                          values manuelly.
  183.  
  184.           Reset menu   : Sets all items to there initial value.
  185.  
  186.           Uninstall    : Use this one to remove DumpExe from memory.
  187.  
  188.     [7] Information about current memory status.
  189.  
  190.           Free  : Amount of free memory.
  191.           Slack : Amount of memory fragment after allocating 4 kb.
  192.  
  193.     [8] Status message from the program and prompt file for user.
  194.  
  195.         Here is some of the error messages that can appeare here :
  196.  
  197.           No size given.
  198.             You have to enter how much memory the program shall dump.
  199.  
  200.           No memory allocated.
  201.             You are trying to auto-config file 2, and you have'nt used
  202.             'allocate 4KB'. You must manuelly enter the data required to dump
  203.  
  204.           Can't auto-config file 2, sorry.
  205.             You must manuelly enter the data required to dump a program.
  206.  
  207.           The PSP-segment is not valid.
  208.             You are using a function that required a valid PSP segment, 
  209.             entered in [2] or [3].
  210.  
  211.           The PSP-segment for file 1 is not valid.
  212.             See the above.
  213.  
  214.           Can't find name.
  215.             DumpEXE is not able to find the name of the program you want
  216.             to dump. The program are using a standard name instead.
  217.  
  218.           Can't uninstall, vector hooked by another program.
  219.             You have loaded another program after this DumpEXE. Unfortunately
  220.             they have hooked the same interrupt. Unload the other program
  221.             first and try again.
  222.  
  223.           Can't allocate necessary memory.
  224.             Boot your machine with less drivers, and try again. If this 
  225.             does'nt help, you are f.....
  226.  
  227.           Out of stack.
  228.             Your memory is fragmented to much. The DumpEXE has 4 kb of stack 
  229.             and in this case it does'nt seem to be enough. Contact me (BUGSY) 
  230.             and ask for a version with more stack :)
  231.             (I'll send it to you!)
  232.  
  233.           Can't release memory.
  234.             This error is most likely coursed by the program you are about to
  235.             dump. It is the stack of this program that have been destroyed. 
  236.             Dump the code and boot your PC. (the dumpfile should be okay,
  237.             I hope...)
  238.  
  239.           Can't make file.
  240.             Ups, a disk error. Check your harddisk with 'chkdsk /f'
  241.  
  242.           Can't write file, disk full ?.
  243.             Free some disk space, and try again.
  244.  
  245.           Can't deallocate memory.
  246.             The MCB (memory control block) have been destroyed. Dump the code
  247.             and boot your PC. (again the dumpfile should be okay, I hope...)
  248.  
  249.           Size is to big, please enter a new one.
  250.             You have entered an invalid size of the program. Max size is
  251.             640 kb. :) Don't you just loooove dos ?...
  252.  
  253. ■ Soft-Ice user notice
  254.  
  255.   If you are using Soft-Ice, the hotkey is disabled. This is because Soft-Ice
  256.   runs in protected mode and have it's own interrupt vector table. To activate
  257.   the exe-dumper, do this at the Soft-Ice command line:
  258.     BPX CS:IP      : So we can return after Int 0FCh has terminated
  259.     GENINT FC      : Start the exe-dumper
  260.     GENINT FC      : Start the exe-dumper again (if you need it)
  261.     BC 0           : Clear the breakpoint set by BPX. The number (here 0) is
  262.                      the name of breakpoint label.
  263.  
  264. ■ How to unpack a exefile
  265.  
  266.   The file named 'unpackme.exe' is a packed exe-file. It is used to illustrate
  267.   how to use this tool, and nothing more. BTW : The file is packed with pklite
  268.   using normal compression.
  269.  
  270.   I will use Turbo Debugger for this example. The reason I do that is : 
  271.   If you know how to use the ultimate debugger Soft-Ice, you really 
  272.   don't need this introduction, in how to unpack a program with a debugger,
  273.   or do you ?
  274.  
  275.  
  276.   If you don't know anything about using a debugger, I advice you to consult
  277.   your debugger's manual.
  278.  
  279.   Try to start the tutorial program UNPACKME.EXE and look at the text.
  280.   The program tells if it's packed or not.
  281.  
  282.   REMEMBER : Start DUMPEXE.EXE before proceeding with next step.
  283.  
  284.   Start debuging unpackme.exe by writing : TD.EXE UNPACKME.EXE
  285.  
  286.   The picture shown to you, by TD (Turbo Debugger) should look something like
  287.   this :
  288.  
  289.   ╔═[■]═CPU 80486═══════════════════════════════╤═══════1═[][]═╗
  290.   ║  cs:0100B89A05         mov    ax,059A        ax 0000   │c=0║
  291.   ║  cs:0103 BA4001         mov    dx,0140      ■  bx 0000   │z=0║
  292.   ║  cs:0106 05EE68         add    ax,68EE      ▒  cx 0000   │s=0║
  293.   ║  cs:0109 3B060200       cmp    ax,[0002]    ▒  dx 0000   │o=0║
  294.   ║  cs:010D 731A           jnb    0129         ▒  si 0000   │p=0║
  295.   ║  cs:010F 2D2000         sub    ax,0020      ▒  di 0000   │a=0║
  296.   ║  cs:0112 FA             cli                 ▒  bp 0000   │i=1║
  297.   ║  cs:0113 8ED0           mov    ss,ax        ▒  sp 0200   │d=0║
  298.   ║  cs:0115 FB             sti                 ▒  ds 68DE   │   ║
  299.   ║  cs:0116 2D1900         sub    ax,0019      ▒  es 68DE   │   ║
  300.   ║  cs:0119 8EC0           mov    es,ax        ▒  ss 6A35   │   ║
  301.   ║  cs:011B 50             push   ax           ▒  cs 68DE   │   ║
  302.   ║  cs:011C B9C300         mov    cx,00C3        ip 0100   │   ║
  303.   ╟■▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒┤            │   ║
  304.   ║  ds:0000 CD 20 FF 9F 00 9A F0 FE ═  ƒ Ü≡■   │            │   ║
  305.   ║  ds:0008 1D F0 E0 01 7F 36 AA 01 ≡α6¬   ├────────────┴───╢
  306.   ║  ds:0010 7F 36 7C 02 8C 30 5D 22 6|î0]"   │  ss:0202 0779  ║
  307.   ║  ds:0018 01 01 01 00 02 FF FF FF        │  ss:0200F60B  ║
  308.   ╚═════════════════════════════════════════════╧═══════════════─┘
  309.  
  310.   Start executing the code, until you get to cs:0128, shown below.
  311.  
  312.   ╔═[■]═CPU 80486═══════════════════════════════╤═══════1═[][]═╗
  313.   ║  cs:011C B9C300         mov    cx,00C3        ax 6E4F   │c=0║
  314.   ║  cs:011F 33FF           xor    di,di        ■  bx 0000   │z=1║
  315.   ║  cs:0121 57             push   di           ▒  cx 0000   │s=0║
  316.   ║  cs:0122 BE4401         mov    si,0144      ▒  dx 0140   │o=0║
  317.   ║  cs:0125 FC             cld                 ▒  si 02CA   │p=1║
  318.   ║  cs:0126 F3A5           rep movsw           ▒  di 0186   │a=0║
  319.   ║  cs:0128CB             retf                ▒  bp 0000   │i=1║
  320.   ║  cs:0129 B409           mov    ah,09        ▒  sp 01FC   │d=0║
  321.   ║  cs:012B BA3201         mov    dx,0132      ▒  ds 68DE   │   ║
  322.   ║  cs:012E CD21           int    21           ▒  es 6E4F   │   ║
  323.   ║  cs:0130 CD20           int    20           ▒  ss 6E68   │   ║
  324.   ║  cs:0132 4E             dec    si           ▒  cs 68DE   │   ║
  325.   ║  cs:0133 6F             outsw                 ip 0128   │   ║
  326.   ╟■▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒┤            │   ║
  327.   ║  ds:0000 CD 20 FF 9F 00 9A F0 FE ═  ƒ Ü≡■   │            │   ║
  328.   ║  ds:0008 1D F0 E0 01 7F 36 AA 01 ≡α6¬   ├────────────┴───╢
  329.   ║  ds:0010 7F 36 7C 02 8C 30 5D 22 6|î0]"   │  ss:01FE 6E4F  ║
  330.   ║  ds:0018 01 01 01 00 02 FF FF FF        │  ss:01FC0000  ║
  331.   ╚═════════════════════════════════════════════╧═══════════════─┘
  332.  
  333.   The unpacker has copied itself to a location, which is just after the
  334.   unpacked code. Singlestep one instruction, and you will see this :
  335.  
  336.   ╔═[■]═CPU 80486═══════════════════════════════╤═══════1═[][]═╗
  337.   ║  cs:0000FD             std                   ax 6E4F   │c=0║
  338.   ║  cs:0001 8CDB           mov    bx,ds        ■  bx 0000   │z=1║
  339.   ║  cs:0003 53             push   bx           ▒  cx 0000   │s=0║
  340.   ║  cs:0004 83C32D         add    bx,002D      ▒  dx 0140   │o=0║
  341.   ║  cs:0007 03DA           add    bx,dx        ▒  si 02CA   │p=1║
  342.   ║  cs:0009 8CCD           mov    bp,cs        ▒  di 0186   │a=0║
  343.   ║  cs:000B 8BC2           mov    ax,dx        ▒  bp 0000   │i=1║
  344.   ║  cs:000D 80E40F         and    ah,0F        ▒  sp 0200   │d=0║
  345.   ║  cs:0010 B104           mov    cl,04        ▒  ds 68DE   │   ║
  346.   ║  cs:0012 8BF2           mov    si,dx        ▒  es 6E4F   │   ║
  347.   ║  cs:0014 D3E6           shl    si,cl        ▒  ss 6E68   │   ║
  348.   ║  cs:0016 8BCE           mov    cx,si        ▒  cs 6E4F   │   ║
  349.   ║  cs:0018 D1E9           shr    cx,1           ip 0000   │   ║
  350.   ╟■▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒┤            │   ║
  351.   ║  ds:0000 CD 20 FF 9F 00 9A F0 FE ═  ƒ Ü≡■   │            │   ║
  352.   ║  ds:0008 1D F0 E0 01 7F 36 AA 01 ≡α6¬   ├────────────┴───╢
  353.   ║  ds:0010 7F 36 7C 02 8C 30 5D 22 6|î0]"   │  ss:0202 0000  ║
  354.   ║  ds:0018 01 01 01 00 02 FF FF FF        │  ss:02000000  ║
  355.   ╚═════════════════════════════════════════════╧═══════════════─┘
  356.  
  357.   Press pagedown a couple of times, until you get this :
  358.  
  359.   ╔═[■]═CPU 80486═══════════════════════════════╤═══════1═[][]═╗
  360.   ║  cs:0155 8BD0           mov    dx,ax          ax 0000   │c=0║
  361.   ║  cs:0157 8BE8           mov    bp,ax        ■  bx 0000   │z=1║
  362.   ║  cs:0159 8BF0           mov    si,ax        ▒  cx 0000   │s=0║
  363.   ║  cs:015B 8BF8           mov    di,ax        ▒  dx 0000   │o=0║
  364.   ║  cs:015DCB             retf                ▒  si 0000   │p=1║
  365.   ║  cs:015E 0300           add    ax,[bx+si]   ▒  di 0000   │a=0║
  366.   ║  cs:0160 020A           add    cl,[bp+si]   ▒  bp 0000   │i=1║
  367.   ║  cs:0162 0405           add    al,05        ▒  sp 3FFC   │d=0║
  368.   ║  cs:0164 0000           add    [bx+si],al   ▒  ds 68DE   │   ║
  369.   ║  cs:0166 0000           add    [bx+si],al   ▒  es 68DE   │   ║
  370.   ║  cs:0168 0000           add    [bx+si],al   ▒  ss 6A98   │   ║
  371.   ║  cs:016A 06             push   es           ▒  cs 6E4F   │   ║
  372.   ║  cs:016B 07             pop    es             ip 015D   │   ║
  373.   ╟■▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒┤            │   ║
  374.   ║  ds:0000 CD 20 FF 9F 00 9A F0 FE ═  ƒ Ü≡■   │            │   ║
  375.   ║  ds:0008 1D F0 E0 01 7F 36 AA 01 ≡α6¬   ├────────────┴───╢
  376.   ║  ds:0010 7F 36 7C 02 8C 30 5D 22 6|î0]"   │  ss:3FFE 68EE  ║
  377.   ║  ds:0018 01 01 01 00 02 FF FF FF        │  ss:3FFC01EA  ║
  378.   ╚═════════════════════════════════════════════╧═══════════════─┘
  379.   Press F4 at location cs:015d, and press F7. That's it. You have 
  380.   now unpacked the test program. If you have done it right your TD
  381.   showes something like this :
  382.  
  383.   ╔═[■]═CPU 80486═══════════════════════════════╤═══════1═[][]═╗
  384.   ║  cs:01EA9A00009569     call   6995:0000      ax 0000   │c=0║
  385.   ║  cs:01EF 9A0D003369     call   6933:000D    ■  bx 0000   │z=1║
  386.   ║  cs:01F4 55             push   bp           ▒  cx 0000   │s=0║
  387.   ║  cs:01F5 89E5           mov    bp,sp        ▒  dx 0000   │o=0║
  388.   ║  cs:01F7 B80001         mov    ax,0100      ▒  si 0000   │p=1║
  389.   ║  cs:01FA 9ACD029569     call   6995:02CD    ▒  di 0000   │a=0║
  390.   ║  cs:01FF 81EC0001       sub    sp,0100      ▒  bp 0000   │i=1║
  391.   ║  cs:0203 9ACC013369     call   6933:01CC    ▒  sp 4000   │d=0║
  392.   ║  cs:0208 BF5200         mov    di,0052      ▒  ds 68DE   │   ║
  393.   ║  cs:020B 1E             push   ds           ▒  es 68DE   │   ║
  394.   ║  cs:020C 57             push   di           ▒  ss 6A98   │   ║
  395.   ║  cs:020D 8DBE00FF       lea    di,[bp-0100] ▒  cs 68EE   │   ║
  396.   ║  cs:0211 16             push   ss             ip 01EA   │   ║
  397.   ╟■▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒┤            │   ║
  398.   ║  ds:0000 CD 20 FF 9F 00 9A F0 FE ═  ƒ Ü≡■   │            │   ║
  399.   ║  ds:0008 1D F0 E0 01 7F 36 AA 01 ≡α6¬   ├────────────┴───╢
  400.   ║  ds:0010 7F 36 7C 02 8C 30 5D 22 6|î0]"   │  ss:4002 0000  ║
  401.   ║  ds:0018 01 01 01 00 02 FF FF FF        │  ss:40000000  ║
  402.   ╚═════════════════════════════════════════════╧═══════════════─┘
  403.  
  404.   As you can see there is 2 far calls. Those are direct calls. It means
  405.   that it will make a call to a certain location in memory. If we dump the
  406.   memory used by the test program, we will have a image of the memory. But
  407.   this is not enough to make a new exe file. This is because a exefile is not
  408.   just an image of the memory, like a com file is. So what we need is a second
  409.   dump from a different memory location. This is because of the direct call's.
  410.   By comparing the two dump files, we can find the relocation needed to build
  411.   a new exe file. The information like min/max memory usage is taken from the
  412.   original exe file. But let's get back to the tutorial.
  413.  
  414.   Remember the value of SP, DS, ES, SS, CS and IP. Press the two shift keys, 
  415.   and enter the values in there corresponding location in [2]. You will
  416.   probably notice that there is no field for ES, this is because that the
  417.   initial value of ES points to the PSP, so write the value of ES at the PSP
  418.   field.
  419.  
  420.   It is time to tell DumpExe the size of the memory block that we want to dump.
  421.   Use TAB until you get to [4]. Press enter at 'Autodetect size'. There are 
  422.   two ways of getting the size. One is by using the stack, the other is 
  423.   'by PSP'. The one that you should use (99 % of the times) is 'by stack'.
  424.   Press S, and the size have been put into size field. Press enter at 
  425.   'Autodetect name', and the name have been put into the name field. Now it's
  426.   time to dump memory. This is done by pressing enter at 'Dump exe-code'. It 
  427.   will probably do it so fast that you won't notice that a process message will
  428.   appear. 
  429.  
  430.   Press ESC and press F9 in TD. The program has now terminated, and it's 
  431.   time to allocate a 4KB memory block. Start DumpExe again, and press enter 
  432.   at 'Allocate 4Kb'. The menu will change to Deallocate 4Kb. Press ESC, and
  433.   reload our program by pressing F2. Start debuging like you did the first
  434.   time. When you have reached the first instruction of the original code,
  435.   enter all information like CS, SS.... in [3]. To make this this easyer, 
  436.   there is a 'Auto-Config' botton. It will set up all values in [3] by using
  437.   the those you have entered in [2]. Dump the code, and we are almost done.
  438.   Again terminate your program, by pressing F9 in TD. Start DumpExe again,
  439.   and press enter at 'Deallocate 4Kb'. Exit your debugger.
  440.  
  441.   Run the MakeExe program with parameteres : First dump, second dump,
  442.                                              original exefile, new filename.
  443.  
  444.   or like this : MAKEEXE.EXE unpackme.1 unpackme.2 unpackme.exe unpacked.exe
  445.  
  446.   The MakeExe program compares the two memory dump and builds a new exe file
  447.   of the information found in the original exe files exeheader.
  448.  
  449.   After MakeExe has build a new exe file, the screen would look like this :
  450.  
  451.            Exe-maker  v1.2 CARDWARE 1995 by BUGSY of OBSESSiON
  452.  
  453.            Read exeinfo : ooo
  454.            Make new exefile.
  455.            Make temp file.
  456.  
  457.            Process dump files   : o
  458.            Number of relocation : 004Bh
  459.            Add zero code        : oooo
  460.            Size of EXE-header   : 00170h
  461.            Write code           : o
  462.            Write new exeheader.
  463.            All done !
  464.  
  465.   If the message 'End of valid code detected at ...' shows up, just press 'N'
  466.  
  467.   This message means that MakeExe has detected, that the two dumps does not 
  468.   contain valid code/data anymore. Normally one would answer 'No', to whether
  469.   MakeExe should continue or not. If you answer 'yes', the current position 
  470.   would be concidered as a relocation in the exe header. But in special cases,
  471.   where the unpacked exe file is smallere than the packed, one should say 
  472.   yes. Even if MakeExe ask more that one time. But as I said, only in special 
  473.   cases.
  474.  
  475.   I think this would be enough for you to continue on your own. If you have
  476.   any questions about the use of these programs, feel free to contact me.
  477.  
  478.   You can get in touch with me by :
  479.  
  480.     Writing a letter to :
  481.       Benjamin Petersen
  482.       Nybrovej 304, F-48
  483.       DK-2800 Lyngby
  484.       Denmark
  485.  
  486.     E-Mail me at :
  487.       ben@ktas.dk
  488.  
  489.     Call me at :
  490.       +45 45 974-348
  491.  
  492. [BUGSY/OBSESSiON]
  493.  
  494. ■ Greetings
  495.  
  496.   My greetings goes to (no order) :
  497.  
  498.     Spawn/OBSESSiON            : Thanks for the menu system in this production!
  499.     Darkman/VLAD               : Thanks for your help about TSR detection.
  500.     Ping (pingelingelater)     : Thanks for proofreading this documentation.
  501.     Sheap/s!p                  : Are you reading those Asm books I gave you ?
  502.     Motion Man/DOM             : Thanks for a nice ratio.
  503.     HiTech                     : Never put a bug into a bottle of coca cola!
  504.     Zteel/Difussion            : Go nuke that SD....
  505.     Bionic/ECR/STH             : Nice txt in 'UD OG SE MED DSB'.....
  506.     Zero God                   : Still working on that Delta sound packer ?
  507.     Jazz                       : Sorry, but I'd quit smoking. NOOOOT!
  508.     Sketz/Silente PC           : No more logos for 'the top BBS', sad...
  509.     Drake/DOM                  : Thanks for the Soft-Ice tip!
  510.     and all I did'nt remember  : Sorry, kill us in our next life.
  511.  
  512.     A great welcome to our two new musicians : Fading Nimbus and Unison.
  513.     Keep up the good work guys, you have really proofed yourselfs.